package com.info.zhiduoduo.repository.mapper.company;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.info.zhiduoduo.repository.dto.company.CompanyOfflineRechargeDto;
import com.info.zhiduoduo.repository.entity.company.CompanyOfflineRecharge;

import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author bob
 * @since 2020-04-06
 */
public interface CompanyOfflineRechargeMapper extends BaseMapper<CompanyOfflineRecharge> {
//
//	@Select(" select cor.*,c.compname,IFNULL((select SUM(cord.amount) from zdd_company_offline_recharge_detail cord" +
//			" where cord.offline_recharge_id = cor.id), 0) as transferedAmount," +
//			" IFNULL((select SUM(cord.amount) from " +
//			" zdd_company_offline_recharge_detail cord where cord.offline_recharge_id = cor.id and state = 2), 0)as rechargedAmount " +
//			" from zdd_company_offline_recharge cor " +
//			" join zdd_company c on c.compid = cor.compid " +
//			" where IF(#{compid}=0,1=1, cor.compid = #{compid}) " +
//			" and CONCAT(cor.recharge_no,cor.acct_name) like '%${rechargeNo}%' " +
//			" and IF(#{state}=0, 1=1, cor.state = #{state}) " +
//			" and DATE(cor.createtime) between #{startDate} and #{endDate} " +
//			" order by cor.id desc ")
//	List<CompanyOfflineRechargeDto> findOrderList(int compid, String rechargeNo, int state, Date startDate, Date endDate);
//
//	@Select(" select cor.*,c.compname,IFNULL((select SUM(cord.amount) from zdd_company_offline_recharge_detail cord" +
//			" where cord.offline_recharge_id = cor.id), 0) as transferedAmount," +
//			" IFNULL((select SUM(cord.amount) from " +
//			" zdd_company_offline_recharge_detail cord where cord.offline_recharge_id = cor.id and state = 2), 0)as rechargedAmount " +
//			" from zdd_company_offline_recharge cor " +
//			" join zdd_company c on c.compid = cor.compid " +
//			" where cor.id = #{id} ")
//	CompanyOfflineRechargeDto findById(int id);
//
//	@Select(" select cor.*,c.compname,IFNULL((select SUM(cord.amount) from zdd_company_offline_recharge_detail cord" +
//			" where cord.offline_recharge_id = cor.id), 0) as transferedAmount," +
//			" IFNULL((select SUM(cord.amount) from " +
//			" zdd_company_offline_recharge_detail cord where cord.offline_recharge_id = cor.id and state = 2), 0)as rechargedAmount " +
//			" from zdd_company_offline_recharge cor " +
//			" join zdd_company c on c.compid = cor.compid " +
//			" where cor.recharge_no = #{orderNo} ")
//	CompanyOfflineRechargeDto findByRechargeNo(String orderNo);
}
